package com.dzh.dzhhub.controller;

import com.dzh.dzhhub.entity.User;
import com.dzh.dzhhub.service.UserService;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author DZHooo
 * @version 1.0
 * @date 2021/11/15 20:36
 * @description: TODO
 */


@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;


    @GetMapping("/list")
    @RequiresPermissions(logical = Logical.AND,value = {"user:update","user:add"})
    public List<User> listUser() {
        return userService.listUser();
    }


    @GetMapping("/list1")
    @RequiresPermissions(value = {"user:update"})
    public List<User> listUser1() {
        return userService.listUser();
    }

}
